package com.example.account.service;

import io.seata.rm.tcc.api.BusinessActionContext;
import io.seata.rm.tcc.api.BusinessActionContextParameter;
import io.seata.rm.tcc.api.LocalTCC;
import io.seata.rm.tcc.api.TwoPhaseBusinessAction;

@LocalTCC
public interface IDeductMoney {

    @TwoPhaseBusinessAction(name = "IDeductMoney", commitMethod = "deductCommit", rollbackMethod = "deductCancel")
    public void deduct(@BusinessActionContextParameter(paramName = "userId") String userId,
            @BusinessActionContextParameter(paramName = "money") Integer money);

    public boolean deductCancel(BusinessActionContext context);

    public boolean deductCommit(BusinessActionContext context);

}
